/*
day190
2020.3.5
*/
#include<iostream>
#include<string>
#include<sstream>
using namespace std;

class Solution {
public:
    int countSegments(string s) {
    	int res=0;
		stringstream sstream(s);
		string str;
		while(sstream>>str)
		{
			++res;
		}
		return res;
    }
};

int main()
{
	string s="Hello, my name is John";
	Solution solu;
	cout<<solu.countSegments(s)<<endl;
	return 0;
}
